home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / database / sdb.doc < prev    next >
Text File  |  1984-12-20  |  23KB  |  948 lines

  1. SDB (Small Data Base) documentation:
  2.  
  3.  
  4.  
  5.                        SDB - a Simple Database System
  6.  
  7.                               by David Betz
  8.                             114 Davenport Ave.
  9.                            Manchester, NH 03103
  10.                              (603) 625-4691
  11.  
  12.                         converted to the IBM/PC by
  13.                               David N. Smith
  14.                             44 Ole Musket Lane
  15.                              Danbury CT 06810
  16.                               (203) 748-5934
  17.  
  18.  
  19.         1.0  INTRODUCTION
  20.  
  21.         SDB is a simple database manager for small systems.  It  was
  22.         developed  to  provide  a relatively low overhead system for
  23.         storing data  on  machines  with  limited  disk  and  memory
  24.         resources.   The current version runs on a PDT-11/150 with 2
  25.         RX01 floppy disk drives and 60K bytes of  memory  under  the
  26.         RT-11 operating system, the VAX under VMS,  or on the IBM/PC
  27.         under PC/DOS.
  28.  
  29.         SDB was originally intended  to  be  a  relational  database
  30.         system, so many of the terms used in describing it are taken
  31.         from the relational database literature.  Within the context
  32.         of SDB the user can safely make the following associations:
  33.  
  34.              1.  RELATION can be taken to mean FILE
  35.  
  36.              2.  TUPLE can be taken to mean RECORD
  37.  
  38.              3.  ATTRIBUTE can be taken to mean FIELD
  39.  
  40.         It should be noted that SDB is not a  relationally  complete
  41.         system.   It  provides  the relational operations of SELECT,
  42.         PROJECT, and JOIN, but does not provide the  set  operations
  43.         of  UNION,  INTERSECTION,  or  DIFFERENCE  as  well  as some
  44.         others.
  45.  
  46.  
  47.         2.0  RELATION FILE FORMATS
  48.  
  49.         SDB maintains a separate file for  each  relation  that  the
  50.         user  creates.  This file contains a header block containing
  51.         the definition of the relation including the names and types
  52.         of  all  of the relation's attributes.  The remainder of the
  53.         file contains fixed length records each containing one tuple
  54.         from the relation.
  55.  
  56.         Tuples can be of three types:
  57.  
  58.              1.  active - tuples that contain actual active data
  59.  
  60.              2.  deleted - tuples that have been deleted
  61.  
  62.              3.  unused - tuples that haven't been used yet
  63.  
  64.  
  65.         Initially, all tuples are  unused.   When  a  new  tuple  is
  66.         stored  into  a  relation,  the  first unused tuple is found
  67.         (they are all contiguous at the end of the  relation  file).
  68.         The new tuple is stored as an active tuple.
  69.  
  70.         When a tuple is deleted, it is marked as  such.   The  space
  71.         previously  allocated  to  the  deleted tuple is left unused
  72.         until the relation is compressed.
  73.  
  74.         It is possible that when attempting to store a new tuple, no
  75.         unused  tuple can be found even though the relation contains
  76.         fewer than the maximum active  tuples.   This  happens  when
  77.         tuples  have  been  deleted since the time the relation file
  78.         was last compressed.
  79.  
  80.         The compress function  allows  all  of  the  space  lost  by
  81.         deleting tuples to be regained.  It does this by copying all
  82.         of the active tuples as far backward in the file as possible
  83.         leaving  all  of  the  available space toward the end of the
  84.         file.
  85.  
  86.  
  87.  
  88.         3.0  SELECTION EXPRESSIONS
  89.  
  90.         A selection expression specifies a set of tuples over  which
  91.         some  SDB  operation  is  to  be executed.  The syntax for a
  92.         selection expression is:
  93.  
  94.         <rse>           ::= <rnames> [ where <boolean> ]
  95.         <rnames>        ::= <rname> [ , <rname> ] ...
  96.         <rname>         ::= <relation-name> [ <alias> ]
  97.  
  98.         When a single relation name  is  specified  in  a  selection
  99.         expression,  each  tuple  within  that  relation  becomes  a
  100.         candidate for selection.
  101.  
  102.         When more than one relation name is  specified,  the  tuples
  103.         are  formed  by  taking  the  cross product of all specified
  104.         relations.  If a relation is to be crossed with  itself,  an
  105.         alias must be given to one or both of the occurances of that
  106.         relation name in the selection expression.  This allows  SDB
  107.         to determine which relation occurance is being refered to in
  108.         the boolean part of the selection expression.
  109.  
  110.         After the set of candidate tuples is determined, the boolean
  111.         expression  is evaluated for each candidate.  The candidates
  112.         for which the boolean expression evaluates  to  TRUE  become
  113.         the selected tuples.
  114.  
  115.  
  116.         4.0  INITIALIZATION FILE AND COMMAND FILES
  117.  
  118.         When SDB is first run,  it  attempts  to  read  and  process
  119.         commands  from  a  file  named "SDB.INI".  This file usually
  120.         contains macro definitions, but can contain  any  valid  SDB
  121.         command.   In  addition,  it  is possible to process command
  122.         files from within SDB.   This  is  done  by  typing  an  '@'
  123.         followed by the command file name after the SDB prompt.
  124.  
  125.  
  126.  
  127.         5.0  FILE NAMES
  128.  
  129.         Whenever a file name is allowed in the syntax for a command,
  130.         it  is  possible  to  use  either  an identifier or a quoted
  131.         string.  An identifier is interpreted as the file name and a
  132.         string  is  interpreted  as  a full file specification.  The
  133.         string form allows for the  specification  of  an  alternate
  134.         device or extension.
  135.  
  136.  
  137.  
  138.         6.0  FORM DEFINITION FILES
  139.  
  140.         A form  definition  file  contains  a  template  into  which
  141.         attribute  values  are substituted during a print operation.
  142.         There are two types of information that can be included in a
  143.         form definition:
  144.  
  145.              1.  Literal text
  146.  
  147.              2.  Attribute references
  148.  
  149.         Attribute references are indicated by placing  the  name  of
  150.         the  attribute  being  referenced  between  a  pair of angle
  151.         brackets.  Literal text is anything that is not enclosed  in
  152.         angle brackets.
  153.  
  154.  
  155.         Example:
  156.         ________
  157.  
  158.         print using test amount,category from checks;
  159.  
  160.         Where test.frm contains:
  161.  
  162.         Amount: <amount>
  163.         Category: <category>
  164.  
  165.  
  166.         7.0  ALIASES FOR RELATIONS AND ATTRIBUTES
  167.  
  168.         When a relation or attribute name is specified  in  a  print
  169.         statement,  it  is possible to provide an alternate name for
  170.         that relation or attribute.  This is useful  for  relations,
  171.         when  it  is  necessary to join a relation to itself.  It is
  172.         useful for attributes when it is  desired  that  the  column
  173.         headers  in  a  table be different from the actual attribute
  174.         names.  Also, alternate  attribute  names  can  be  used  in
  175.         references  to that attribute in the where clause as well as
  176.         in a  form  definition  file.   The  syntax  for  specifying
  177.         aliases is:
  178.  
  179.             <name> <alias>
  180.  
  181.  
  182.         Example:
  183.         ________
  184.  
  185.         print using test amount a,category c from checks;
  186.  
  187.         Where test.frm contains:
  188.  
  189.         Amount: <a>
  190.         Category: <c>
  191.  
  192.  
  193.         8.0  BOOLEAN EXPRESSIONS
  194.  
  195.         The syntax for boolean expressions:
  196.  
  197.         <expr>          ::= <land> [ '|' <land> ]
  198.         <land>          ::= <relat> [ '&' <relat> ]
  199.         <relat>         ::= <primary> [ <relop> <primary> ]
  200.         <primary>       ::= <term> [ <addop> <term> ]
  201.         <term>          ::= <unary> [ <mulop> <unary> ]
  202.         <unary>         ::= <factor> | <unop> <unary>
  203.         <factor>        ::= <operand> | '(' <expr> ')'
  204.         <operand>       ::= <number> | <string> | <attribute>
  205.         <attribute>     ::= [ <rname> . ] <aname>
  206.         <relop>         ::= '=' | '<>' | '<' | '>' | '<=' | '>='
  207.         <addop>         ::= '+' | '-'
  208.         <mulop>         ::= '*' | '/'
  209.         <unop>          ::= '+' | '-' | '~'
  210.  
  211.  
  212.         Operators:
  213.  
  214.              1.  '=' - equal
  215.  
  216.              2.  '<>' - not equal
  217.  
  218.              3.  '<' - less than
  219.  
  220.              4.  '>' - greater than
  221.  
  222.              5.  '<=' - less than or equal
  223.  
  224.              6.  '>=' - greater than or equal
  225.  
  226.              7.  '+' - addition or unary plus (not implemented)
  227.  
  228.              8.  '-' - subraction or unary minus (not implemented)
  229.  
  230.              9.  '*' - multiplication (not implemented)
  231.  
  232.             10.  '/' - division (not implemented)
  233.  
  234.             11.  '&' - logical and
  235.  
  236.             12.  '|' - logical or
  237.  
  238.             13.  '~' - logical not
  239.  
  240.         Operands:
  241.  
  242.              1.  number - a string of digits containing at most  one
  243.                  decimal point
  244.  
  245.              2.  string - a string of characters enclosed in  double
  246.                  quotes
  247.  
  248.  
  249.              3.  attribute - an attribute name optionally  qualified
  250.                  by a relation name
  251.  
  252.  
  253.         9.0  INTERACTIVE COMMAND DESCRIPTIONS
  254.  
  255.         Function:
  256.         _________
  257.  
  258.         Create a relation file
  259.  
  260.  
  261.         Format:
  262.         _______
  263.  
  264.         create <rname> ( <alist> ) <size>
  265.  
  266.  
  267.         Rules:
  268.         ______
  269.  
  270.              1.  <rname> is the name of the relation file
  271.  
  272.              2.  <alist> is a list of attribute definitions  of  the
  273.                  form:
  274.  
  275.                    <aname> { char | num } <size>
  276.  
  277.                  where:
  278.  
  279.                  1.  <aname> is the name of the attribute
  280.  
  281.                  2.  the type of the attribute is either  "char"  or
  282.                      "num"
  283.  
  284.                  3.  <size> is the number of bytes allocated to  the
  285.                      attribute value
  286.  
  287.  
  288.              3.  <size> is the maximum number of tuples the file  is
  289.                  to hold
  290.  
  291.  
  292.  
  293.         Example:
  294.         ________
  295.  
  296.         create checks (
  297.             number      num     4
  298.             date        char    8
  299.             payee       char    20
  300.             amount      num     8
  301.             category    char    5
  302.         ) 200
  303.  
  304.         This command creates a relation file named "checks.sdb" with
  305.         attributes   "number",   "date",   "payee",   "amount",  and
  306.         "category" and space to store 200 tuples.
  307.  
  308.  
  309.         Function:
  310.         _________
  311.  
  312.         Insert tuples into a relation
  313.  
  314.  
  315.         Format:
  316.         _______
  317.  
  318.         insert <rname>
  319.  
  320.  
  321.         Rules:
  322.         ______
  323.  
  324.              1.  <rname> is the name of a relation
  325.  
  326.              2.  the user will be prompted for  the  values  of  the
  327.                  attributes for the tuple to be inserted
  328.  
  329.              3.  a  null  response  to  an  attribute  prompt   will
  330.                  terminate tuple entry
  331.  
  332.              4.  if a null value is desired, a single space  can  be
  333.                  entered
  334.  
  335.  
  336.  
  337.         Function:
  338.         _________
  339.  
  340.         Delete tuples from a set of relations
  341.  
  342.  
  343.         Format:
  344.         _______
  345.  
  346.         delete <rse> ;
  347.  
  348.  
  349.         Rules:
  350.         ______
  351.  
  352.              1.  <rse> is a tuple selection expression
  353.  
  354.              2.  selected tuples are deleted
  355.  
  356.  
  357.  
  358.         Example:
  359.         ________
  360.  
  361.         delete checks where category = "junk";
  362.  
  363.  
  364.  
  365.         Function:
  366.         _________
  367.  
  368.         Update the values of selected attributes in selected tuples
  369.  
  370.  
  371.         Format:
  372.         _______
  373.  
  374.         update { <attrs> | * } from <rse> ;
  375.  
  376.  
  377.         Rules:
  378.         ______
  379.  
  380.              1.  <attrs> is a list of attribute names to be updated
  381.  
  382.              2.  * means all attributes
  383.  
  384.              3.  <rse> is a tuple selection expression
  385.  
  386.              4.  for each  set  of  selected  tuples,  the  user  is
  387.                  prompted for new values for the selected attributes
  388.  
  389.              5.  a null response to an attribute prompt will  retain
  390.                  the previous attribute value
  391.  
  392.              6.  if a null value is desired, a single space  can  be
  393.                  entered
  394.  
  395.  
  396.  
  397.         Example:
  398.         ________
  399.  
  400.         update amount,category from checks where number > 10;
  401.  
  402.  
  403.         Function:
  404.         _________
  405.  
  406.         Print a table of values of selected attributes
  407.  
  408.  
  409.         Format:
  410.         _______
  411.  
  412.         print [ using <fname> ] { <attrs> | * } from  <rse>  [  into
  413.         <fname> ] ;
  414.  
  415.  
  416.         Rules:
  417.         ______
  418.  
  419.              1.  using  <fname>  indicates  output  using   a   form
  420.                  definition file (.FRM)
  421.  
  422.              2.  <attrs> is a list of attribute names to be printed
  423.  
  424.              3.  * means all attributes
  425.  
  426.              4.  <rse> is a tuple selection expression
  427.  
  428.              5.  <fname> is the name of an file to which  the  table
  429.                  will be output (.TXT)
  430.  
  431.              6.  if the output file name is omitted,  output  is  to
  432.                  the terminal
  433.  
  434.              7.  for each set of selected tuples, a table  entry  is
  435.                  printed containing the selected attributes
  436.  
  437.  
  438.  
  439.         Example:
  440.         ________
  441.  
  442.         print payee,amount from checks where category = "junk";
  443.  
  444.  
  445.         Function:
  446.         _________
  447.  
  448.         Import tuples from a file into a relation
  449.  
  450.  
  451.         Format:
  452.         _______
  453.  
  454.         import <fname> into <rname>
  455.  
  456.  
  457.         Rules:
  458.         ______
  459.  
  460.              1.  <fname> is the name of the input file (.DAT)
  461.  
  462.              2.  the input file contains the  values  of  the  tuple
  463.                  attributes with each on a separate line
  464.  
  465.              3.  <rname> is the name of a relation
  466.  
  467.              4.  tuples are appended to the named relation
  468.  
  469.  
  470.  
  471.         Function:
  472.         _________
  473.  
  474.         Export tuples from a relation into a file
  475.  
  476.  
  477.         Format:
  478.         _______
  479.  
  480.         export <rname> [ into <fname> ] ;
  481.  
  482.  
  483.         Rules:
  484.         ______
  485.  
  486.              1.  <rname> is the name of a relation
  487.  
  488.              2.  <fname> is the name of the output file (.DAT)
  489.  
  490.              3.  if the output file name is omitted,  output  is  to
  491.                  the terminal
  492.  
  493.              4.  tuples are written to  the  output  file  with  one
  494.                  attribute value per line
  495.  
  496.  
  497.  
  498.         Function:
  499.         _________
  500.  
  501.         Extract the definition of a relation into a file
  502.  
  503.  
  504.         Format:
  505.         _______
  506.  
  507.         extract <rname> [ into <fname> ] ;
  508.  
  509.  
  510.         Rules:
  511.         ______
  512.  
  513.              1.  <rname> is the name of a relation
  514.  
  515.              2.  <fname> is the name of the output file (.DEF)
  516.  
  517.              3.  if the output file name is omitted,  output  is  to
  518.                  the terminal
  519.  
  520.              4.  the definition of the relation is  written  to  the
  521.                  output file
  522.  
  523.  
  524.  
  525.         Function:
  526.         _________
  527.  
  528.         Compress a relation file
  529.  
  530.  
  531.         Format:
  532.         _______
  533.  
  534.         compress <rname>
  535.  
  536.  
  537.         Rules:
  538.         ______
  539.  
  540.              1.  <rname> is the name of a relation file
  541.  
  542.              2.  tuples are copied toward the front of the  relation
  543.                  file  such  that  any  space  freed  by  previously
  544.                  deleted tuples becomes adjacent to the  free  space
  545.                  at the end of the file, thus becoming available for
  546.                  use in inserting new tuples
  547.  
  548.  
  549.  
  550.         Function:
  551.         _________
  552.  
  553.         Sort a relation file
  554.  
  555.  
  556.         Format:
  557.         _______
  558.  
  559.         sort <rname> by <sname> { , <sname } ...  ;
  560.  
  561.  
  562.         Rules:
  563.         ______
  564.  
  565.              1.  <rname> is the name of a relation file
  566.  
  567.              2.  <sname> is the name of  an  attribute  to  sort  on
  568.                  followed optionally by "ascending" or "descending"
  569.  
  570.              3.  if a sort order  is  not  specified,  ascending  is
  571.                  assumed
  572.  
  573.              4.  tuples within the  relation  are  sorted  in  place
  574.                  using the attributes indicated
  575.  
  576.  
  577.  
  578.         Function:
  579.         _________
  580.  
  581.         Define a macro
  582.  
  583.  
  584.         Format:
  585.         _______
  586.  
  587.         define <mname>
  588.  
  589.  
  590.         Rules:
  591.         ______
  592.  
  593.              1.  <mname> is the name of the macro being defined
  594.  
  595.              2.  if a macro with the specified name already  exists,
  596.                  it is replaced
  597.  
  598.              3.  after entering the define command, definition  mode
  599.                  is entered
  600.  
  601.              4.  definition  mode  is  indicated   by   the   prompt
  602.                  "SDB-DEF>"
  603.  
  604.              5.  all lines typed in definition mode are added to the
  605.                  macro definition
  606.  
  607.              6.  a blank line terminates definition mode
  608.  
  609.              7.  a macro can be deleted by entering a blank line  as
  610.                  the only line in the definition
  611.  
  612.              8.  after a macro is defined, every  occurance  of  the
  613.                  macro name is replaced by the macro definition
  614.  
  615.  
  616.  
  617.         Function:
  618.         _________
  619.  
  620.         Show a macro definition
  621.  
  622.  
  623.         Format:
  624.         _______
  625.  
  626.         show <mname>
  627.  
  628.  
  629.         Rules:
  630.         ______
  631.  
  632.              1.  <mname> is the name of a macro whose definition  is
  633.                  to be shown
  634.  
  635.  
  636.  
  637.         Function:
  638.         _________
  639.  
  640.         Print a short help message
  641.  
  642.  
  643.  
  644.         Format:
  645.         _______
  646.  
  647.         help
  648.  
  649.  
  650.         Rules:
  651.         ______
  652.  
  653.              1.  (none)
  654.  
  655.  
  656.  
  657.         Function:
  658.         _________
  659.  
  660.         Exit from SDB
  661.  
  662.  
  663.         Format:
  664.         _______
  665.  
  666.         exit
  667.  
  668.  
  669.         Rules:
  670.         ______
  671.  
  672.              1.  (none)
  673.  
  674.  
  675.  
  676.         10.0  PROGRAM INTERFACE
  677.  
  678.         SDB provides a callable program interface to allow  programs
  679.         written  in  DECUS-C  to access relation files.  In order to
  680.         use the call interface, the users program should  be  linked
  681.         with  the SDBUSR.OBJ object library.  Also, additional stack
  682.         space should be allocated at link  time  using  the  /BOTTOM
  683.         qualifier  on  the link command.  /BOTTOM:3000 seems to work
  684.         well, but it is probably possible to get away with less.
  685.  
  686.         Example:
  687.         ________
  688.  
  689.         #include <stdio.h>
  690.         #include "sdb.h"
  691.  
  692.         main()
  693.         {
  694.             DB_SEL *sptr;
  695.             char payee[100],amount[100];
  696.  
  697.             /* setup retrieval */
  698.             if ((sptr = db_retrieve("checks where amount > 25.00")) == NULL) {
  699.                 printf("*** error: %s ***\n",db_ertxt(dbv_errcode));
  700.                 exit();
  701.             }
  702.  
  703.             /* bind user variables to attributes */
  704.             db_bind(sptr,"checks","payee",payee);
  705.             db_bind(sptr,"checks","amount",amount);
  706.  
  707.             /* loop through selection */
  708.             while (db_fetch(sptr))
  709.                 printf("%s\t%s\n",payee,amount);
  710.  
  711.             /* finish selection */
  712.             db_done(sptr);
  713.         }
  714.  
  715.  
  716.         Function:
  717.         _________
  718.  
  719.         Setup a tuple retrieval context
  720.  
  721.  
  722.         Format:
  723.         _______
  724.  
  725.         dbptr = db_retrieve(sexpr [ ,arg ]...)
  726.  
  727.  
  728.         Rules:
  729.         ______
  730.  
  731.              1.  sexpr is a pointer to a string containing an rse
  732.  
  733.              2.  arg is a "printf" argument
  734.  
  735.              3.  dbptr is a database context pointer
  736.  
  737.              4.  db_retrieve returns NULL on errors
  738.  
  739.              5.  on errors, the error code is in dbv_errcode
  740.  
  741.  
  742.  
  743.         Function:
  744.         _________
  745.  
  746.         Fetch the next set of tuples from a retrieval context
  747.  
  748.  
  749.         Format:
  750.         _______
  751.  
  752.         db_fetch(dbptr)
  753.  
  754.  
  755.         Rules:
  756.         ______
  757.  
  758.              1.  dbptr is a database context pointer
  759.  
  760.              2.  updates the values of all bound user variables
  761.  
  762.              3.  db_fetch returns FALSE if no more tuples  match  or
  763.                  if an error occurs
  764.  
  765.              4.  on errors, the error code is in dbv_errcode
  766.  
  767.  
  768.  
  769.         Function:
  770.         _________
  771.  
  772.         Update the current tuple within a retrieval context
  773.  
  774.  
  775.         Format:
  776.         _______
  777.  
  778.         db_update(dbptr)
  779.  
  780.  
  781.         Rules:
  782.         ______
  783.  
  784.              1.  dbptr is a database context pointer
  785.  
  786.              2.  db_update returns FALSE if an error occurs
  787.  
  788.              3.  on errors, the error code is in dbv_errcode
  789.  
  790.  
  791.  
  792.         Function:
  793.         _________
  794.  
  795.         Store a new tuple within a retrieval context
  796.  
  797.  
  798.         Format:
  799.         _______
  800.  
  801.         db_store(dbptr)
  802.  
  803.  
  804.         Rules:
  805.         ______
  806.  
  807.              1.  dbptr is a database context pointer
  808.  
  809.              2.  db_store returns FALSE if an error occurs
  810.  
  811.              3.  on errors, the error code is in dbv_errcode
  812.  
  813.  
  814.  
  815.         Function:
  816.         _________
  817.  
  818.         Bind a user variable to  the  value  of  a  tuple  attribute
  819.         within a retrieval context
  820.  
  821.  
  822.         Format:
  823.         _______
  824.  
  825.         db_bind(dbptr,rname,aname,value)
  826.  
  827.  
  828.         Rules:
  829.         ______
  830.  
  831.              1.  dbptr is a database context pointer
  832.  
  833.              2.  rname is a pointer to the relation name
  834.  
  835.              3.  aname is a pointer to the attribute name
  836.  
  837.              4.  value is a pointer to a character array to  receive
  838.                  the attribute value
  839.  
  840.              5.  db_bind returns FALSE if an error occurs
  841.  
  842.              6.  on errors, the error code is in dbv_errcode
  843.  
  844.  
  845.  
  846.         Function:
  847.         _________
  848.  
  849.         Get the value  of  a  tuple  attribute  within  a  retrieval
  850.         context
  851.  
  852.  
  853.         Format:
  854.         _______
  855.  
  856.         db_get(dbptr,rname,aname,value)
  857.  
  858.  
  859.         Rules:
  860.         ______
  861.  
  862.              1.  dbptr is a database context pointer
  863.  
  864.              2.  rname is a pointer to the relation name
  865.  
  866.              3.  aname is a pointer to the attribute name
  867.  
  868.              4.  value is a pointer to a character array to  receive
  869.                  the attribute value
  870.  
  871.              5.  db_get returns FALSE if an error occurs
  872.  
  873.              6.  on errors, the error code is in dbv_errcode
  874.  
  875.  
  876.  
  877.         Function:
  878.         _________
  879.  
  880.         Put the value  of  a  tuple  attribute  within  a  retrieval
  881.         context
  882.  
  883.  
  884.         Format:
  885.         _______
  886.  
  887.         db_put(dbptr,rname,aname,value)
  888.  
  889.  
  890.         Rules:
  891.         ______
  892.  
  893.              1.  dbptr is a database context pointer
  894.  
  895.              2.  rname is a pointer to the relation name
  896.  
  897.              3.  aname is a pointer to the attribute name
  898.  
  899.              4.  value is a pointer to the new value
  900.  
  901.              5.  db_put returns FALSE if an error occurs
  902.  
  903.              6.  on errors, the error code is in dbv_errcode
  904.  
  905.  
  906.  
  907.         Function:
  908.         _________
  909.  
  910.         Discontinue usage of a retrieval context
  911.  
  912.  
  913.  
  914.         Format:
  915.         _______
  916.  
  917.         db_done(dbptr)
  918.  
  919.  
  920.         Rules:
  921.         ______
  922.  
  923.              1.  dbptr is a database context pointer
  924.  
  925.  
  926.  
  927.         Function:
  928.         _________
  929.  
  930.         Translate an error code to an error message text
  931.  
  932.  
  933.         Format:
  934.         _______
  935.  
  936.         db_ertxt(errcode)
  937.  
  938.  
  939.         Rules:
  940.         ______
  941.  
  942.              1.  errcode is an SDB error code
  943.  
  944.              2.  db_ertxt returns a pointer  to  the  error  message
  945.                  text
  946.  
  947.  
  948.